import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner scanner=new Scanner(System.in);
        int n=scanner.nextInt();
        int[] nums=new int[n];
        for(int i=0;i<nums.length;i++){
            nums[i]=scanner.nextInt();
        }
        int val= scanner.nextInt();
        int sum=removeElement(nums,val);
        System.out.println(sum);
    }
    public static int removeElement(int[] nums,int val){
        int slow=0,fast=0;
        while (fast<nums.length){
            if(nums[fast]!=val){
                slow++;
            }
            fast++;
        }
        return slow;
    }
}